#!/bin/bash
function init(){
	#获取http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
	#curl: (6) Could not resolve host: dl.fedoraproject.org; 未知的名称或服务
	rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
	rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
	yum -y install wget yum-utils yum-plugin-priorities.noarch
	yum-config-manager --add-repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
	# wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS7-Base-163.repo
	yum clean all
	yum makecache fast
	#firewalld firewall-config
	yum -y install openssh-clients vim lrzsz gcc gcc-c++ automake pcre pcre-devel zlip zlib-devel openssl openssl-devel git wget net-tools lsof sed yum-utils nethogs
	#设置VIM：显示行号
	echo 'set number' >> /etc/vimrc
	chmod +x /etc/rc.d/rc.local
	#设置git
	git config --global user.name "jlcon"
	git config --global user.email "jlcon@qq.com"
	git config --global credential.helper store
	git config --global push.default simple
	#设置ulimit
	sed -i 's/#DefaultLimitNOFILE=/DefaultLimitNOFILE=1024000/' /etc/systemd/system.conf
	sed -i 's/#DefaultLimitNPROC=/DefaultLimitNPROC=1024000/' /etc/systemd/system.conf
	#设置ssh端口为2049
	sed -i s'/#Port 22/Port 2049/' /etc/ssh/sshd_config
	#git
	cd /home && git clone https://gitee.com/null_884_1787/shell.git
}